package com.tgky.ybzb.neo4j;

import org.neo4j.driver.*;

/**
 * @author Lixx
 * @date 2024/9/4 16:50
 */
public class test {
    public static void main(String[] args) {
       Driver driver= GraphDatabase.driver("bolt://localhost:7687", AuthTokens.basic("neo4j", "12345678"));

        Session session = driver.session();
        Transaction tx = session.beginTransaction();
        Result result = tx.run("match (n:Person {name:'test'}) return n.name");
        // 处理查询结果
        while (result.hasNext()) {
            Record record = result.next();
            System.out.println();
        }
        tx.commit();
        // 关闭Session对象
        session.close();
        driver.close();
    }
}
